欧美一区2区三区4区公司二百,国产精品婷婷午夜在线观看,自拍偷拍亚洲精品,国产美女诱惑一区二区

Linux公共服務(wù)組件之時(shí)間同步chrony

一、簡(jiǎn)介

定義:chrony 是網(wǎng)絡(luò)時(shí)間協(xié)議(NTP)的通用實(shí)現(xiàn)。

chrony 包含兩個(gè)程序:chronyd 是一個(gè)可以在啟動(dòng)時(shí)啟動(dòng)的守護(hù)程序。chronyc 是一個(gè)命令行界面程序,用于監(jiān)視 chronyd 的性能并在運(yùn)行時(shí)更改各種操作參數(shù)。

時(shí)間概念:

UTC (Universal Time Coordinated):世界標(biāo)準(zhǔn)時(shí)間,屬于世界統(tǒng)一世界

GMT (Greenwich Mean Time):英國(guó)倫敦郊區(qū)的皇家格林尼治天文臺(tái)的標(biāo)準(zhǔn)時(shí)間,因?yàn)楸境踝游缇€被定義在通過(guò)那里的經(jīng)線。(UTC與GMT時(shí)間基本相同,因此不做區(qū)分)

CST (China Standard Time):中國(guó)標(biāo)準(zhǔn)時(shí)間,CMT + 8 = UTC + 8 = CST

DST(Daylight Saving Time):夏令時(shí)指在夏天太陽(yáng)升起的比較早時(shí),將時(shí)間撥快一小時(shí),以提早日光的使用。

二、安裝配置

測(cè)試環(huán)境:

IP 備注
120.10.10.10 Chrony服務(wù)
120.10.10.11 Chrony客戶端

服務(wù)端和客戶端均安裝軟件包:

yum -y install chrony
systemctl enable chronyd
systemctl start chronyd

服務(wù)端配置,注意兩個(gè)改動(dòng):

# 使用 pool.ntp.org 項(xiàng)目中的公共服務(wù)器。以server開(kāi),理論上想添加多少時(shí)間服務(wù)器都可以。
# 建議添加ping較低的公網(wǎng)服務(wù)器地址
# 改動(dòng)1
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server ntp.aliyun.com iburst
server time.asia.apple.com iburst
server time.windows.com iburst
server cn.pool.ntp.org iburst

# 根據(jù)實(shí)際時(shí)間計(jì)算出服務(wù)器增減時(shí)間的比率,然后記錄到一個(gè)文件中,在系統(tǒng)重啟后為系統(tǒng)做出最佳時(shí)間補(bǔ)償調(diào)整。
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift

# 如果系統(tǒng)時(shí)鐘的偏移量大于1秒,則允許系統(tǒng)時(shí)鐘在前三次更新中步進(jìn)。
# Allow the system clock to be stepped in the first three updates if its offset is larger than 1 second.
makestep 1.0 3

# 啟用實(shí)時(shí)時(shí)鐘(RTC)的內(nèi)核同步。
# Enable kernel synchronization of the real-time clock (RTC).
rtcsync

# 通過(guò)使用 hwtimestamp 指令啟用硬件時(shí)間戳
# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *

# Increase the minimum number of selectable sources required to adjust the system clock.
#minsources 2

# 改動(dòng)2
# 指定 NTP 客戶端地址或網(wǎng)段,以允許或拒絕連接到扮演時(shí)鐘服務(wù)器的機(jī)器
# Allow NTP client access from local network.
allow 120.10.10.0/24

# Serve time even if not synchronized to a time source.
#local stratum 10

# 指定包含 NTP 身份驗(yàn)證密鑰的文件。
# Specify file containing keys for NTP authentication.
#keyfile /etc/chrony.keys

# 指定日志文件的目錄。
# Specify directory for log files.
logdir /var/log/chrony

# 選擇日志文件要記錄的信息。
# Select which information is logged.
#log measurements statistics tracking

服務(wù)端開(kāi)啟同步功能:

systemctl enable chronyd
systemctl restart chronyd

# 查看時(shí)間同步狀態(tài)
timedatectl status
# 開(kāi)啟網(wǎng)絡(luò)時(shí)間同步
timedatectl set-ntp true

客戶端配置,也注意兩個(gè)改動(dòng):

# 使用 pool.ntp.org 項(xiàng)目中的公共服務(wù)器。以server開(kāi),理論上想添加多少時(shí)間服務(wù)器都可以。
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# 改動(dòng)1
server 120.10.10.10 iburst

# 根據(jù)實(shí)際時(shí)間計(jì)算出服務(wù)器增減時(shí)間的比率,然后記錄到一個(gè)文件中,在系統(tǒng)重啟后為系統(tǒng)做出最佳時(shí)間補(bǔ)償調(diào)整。
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift

# 如果系統(tǒng)時(shí)鐘的偏移量大于1秒,則允許系統(tǒng)時(shí)鐘在前三次更新中步進(jìn)。
# Allow the system clock to be stepped in the first three updates if its offset is larger than 1 second.
makestep 1.0 3

# 啟用實(shí)時(shí)時(shí)鐘(RTC)的內(nèi)核同步。
# Enable kernel synchronization of the real-time clock (RTC).
rtcsync

# 通過(guò)使用 hwtimestamp 指令啟用硬件時(shí)間戳
# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *

# Increase the minimum number of selectable sources required to adjust the system clock.
#minsources 2

# 指定 NTP 客戶端地址,以允許或拒絕連接到扮演時(shí)鐘服務(wù)器的機(jī)器
# Allow NTP client access from local network.
# 改動(dòng)2
allow 120.10.10.10

# Serve time even if not synchronized to a time source.
#local stratum 10

# 指定包含 NTP 身份驗(yàn)證密鑰的文件。
# Specify file containing keys for NTP authentication.
#keyfile /etc/chrony.keys

# 指定日志文件的目錄。
# Specify directory for log files.
logdir /var/log/chrony

# 選擇日志文件要記錄的信息。
# Select which information is logged.
#log measurements statistics tracking

三、使用

修改時(shí)區(qū)或日期時(shí)間(首先配置):

# 查看日期時(shí)間、時(shí)區(qū)及 NTP 狀態(tài)
timedatectl

# 查看時(shí)區(qū)列表
timedatectl list-timezones
timedatectl list-timezones | ?grep ?-E "Asia/S.*"

# 修改時(shí)區(qū)
timedatectl set-timezone Asia/Shanghai

# 修改日期時(shí)間(可以只修改其中一個(gè))
timedatectl set-time "2019-09-19 15:50:20"

# 開(kāi)啟 NTP,true表示開(kāi)啟
timedatectl set-ntp true/flase

# 查看日期時(shí)間、時(shí)區(qū)及 NTP 狀態(tài)
timedatectl

# 查看時(shí)區(qū)列表
timedatectl list-timezones
timedatectl list-timezones | ?grep ?-E "Asia/S.*"

# 修改時(shí)區(qū)
timedatectl set-timezone Asia/Shanghai

# 修改日期時(shí)間(可以只修改其中一個(gè))
timedatectl set-time "2019-09-19 15:50:20"

# 開(kāi)啟 NTP,true表示開(kāi)啟
timedatectl set-ntp true/flase

Chronyc命令:

# 查看 ntp_servers
chronyc sources -v

# 查看 ntp_servers 狀態(tài)
chronyc sourcestats -v

# 查看 ntp_servers 是否在線
chronyc activity -v

# 查看 ntp 詳細(xì)信息
chronyc tracking -v

Linux公共服務(wù)組件之時(shí)間同步chrony

文章鏈接: http://m.qzkangyuan.com/9980.html

文章標(biāo)題:Linux公共服務(wù)組件之時(shí)間同步chrony

文章版權(quán):夢(mèng)飛科技所發(fā)布的內(nèi)容,部分為原創(chuàng)文章,轉(zhuǎn)載請(qǐng)注明來(lái)源,網(wǎng)絡(luò)轉(zhuǎn)載文章如有侵權(quán)請(qǐng)聯(lián)系我們!

聲明:本站所有文章,如無(wú)特殊說(shuō)明或標(biāo)注,均為本站原創(chuàng)發(fā)布。任何個(gè)人或組織,在未征得本站同意時(shí),禁止復(fù)制、盜用、采集、發(fā)布本站內(nèi)容到任何網(wǎng)站、書(shū)籍等各類媒體平臺(tái)。如若本站內(nèi)容侵犯了原著者的合法權(quán)益,可聯(lián)系我們進(jìn)行處理。

給TA打賞
共{{data.count}}人
人已打賞
建站教程投稿分享

認(rèn)證協(xié)議LDAP

2022-9-13 16:22:43

建站教程投稿分享

Linux公共服務(wù)組件之DNS

2022-9-14 12:28:04

0 條回復(fù) A文章作者 M管理員
    暫無(wú)討論,說(shuō)說(shuō)你的看法吧
?
個(gè)人中心
購(gòu)物車
優(yōu)惠劵
今日簽到
有新私信 私信列表
搜索
主站蜘蛛池模板: 信宜市| 敦化市| 兴隆县| 滕州市| 清新县| 钟山县| 广饶县| 巴彦县| 泾阳县| 来安县| 余姚市| 枣庄市| 大石桥市| 漳州市| 阜南县| 和龙市| 昆明市| 宜兴市| 南陵县| 庐江县| 石泉县| 全南县| 昔阳县| 宣武区| 库尔勒市| 公主岭市| 黄山市| 翁牛特旗| 万荣县| 纳雍县| 吴川市| 鄱阳县| 平武县| 遵义市| 资阳市| 红河县| 台东县| 凤翔县| 吕梁市| 吉安县| 锡林郭勒盟|